home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / batchut / unicda15.zip / UNI-CDA.DOC < prev   
Text File  |  1993-10-23  |  8KB  |  179 lines

  1.                                  UNI-CDA 1.50
  2.                     (UniNova's Check Disk Availability)
  3.                  (c) 1993 by UniNova Services Corporation
  4.  
  5. TABLE OF CONTENTS
  6. -----------------
  7.     What is CDA? ................................................... 1
  8.     Disclaimer ..................................................... 1
  9.     How To... ...................................................... 1
  10.         Run the CDA program ........................................ 1
  11.         Use CDA in a batch file .................................... 2
  12.             Sample batch #1 ........................................ 2
  13.             Sample batch #2 ........................................ 2
  14.     Copyright ...................................................... 3
  15.     Contacting UniNova ............................................. 3
  16.     Closing Notes .................................................. 3
  17.  
  18. WHAT IS CDA?
  19. ------------
  20.  
  21. CDA is a simple program to check if a disk is ready to be read.  It is handy
  22. in batch files (e.g., BBS maintenance batch files) to check that a drive is
  23. ready before using it (it's annoying to have a BBS batch file hang up, waiting
  24. or the Sysop to press (A)bort, (R)etry, etc.).  CDA will return a DOS error-
  25. level of 1 if the drive is NOT ready, and 0 if it -is- ready.  CDA may be
  26. distributed and used freely; source code may be purchased for $15.  See the
  27. section CONTACTING UNINOVA for more information about obtaining the source
  28. code.  See the section COPYRIGHT for additional information about your rights
  29. regarding CDA.
  30.  
  31. DISCLAIMER
  32. ----------
  33.  
  34. By using CDA on your computer, you agree to assume full responsibility for
  35. the effects (or lack of effect) of the program on your system.  You agree to
  36. hold UniNova Services Corporation blameless and without liability, even in
  37. the event that some type of damage occurs.  CDA IS PROVIDED AS IS, WITH NO
  38. WARRANTY OR GUARANTEE, EXPRESS OR IMPLIED, OF ANY KIND.  This implicit agree-
  39. ment between you, the user, and UniNova Services Corporation is governed by
  40. the laws of the State of Delaware.
  41.  
  42. HOW TO...
  43. ---------
  44.  
  45.     RUN THE CDA PROGRAM:
  46.     --------------------
  47.     Simply make a call to the program from the DOS prompt or batch file,
  48.     giving it one parameter indicating the drive letter to check.  CDA will
  49.     use the first letter of the first parameter, so all four of these
  50.     commands:
  51.         CDA A:
  52.         CDA A DRIVE
  53.         cda a:\
  54.         CDA APPLES AND ORANGES
  55.     will check drive A to see if it is ready for use.  Then, you just need
  56.     to test the DOS errorlevel.  (See your DOS manual if you need specific
  57.     information about DOS errorlevels.)  CDA is not case sensitive.  The
  58.     program will give a terse visual message indicating its results.
  59.                                                                            
  60.     USE CDA IN A BATCH FILE
  61.     -----------------------
  62.     As always, it is important to check errorlevels from the highest to
  63.     lowest, as DOS will return TRUE for a command IF ERRORLEVEL n in any
  64.     condition where the errorlevel is n or higher.  The original purpose
  65.     for CDA was to check a CD-ROM drive to auto-detect the CD in the drive
  66.     (for the UniNova Support BBS).  However, it is not limited to use with
  67.     CD-ROM drives.  Here are two example batch files in which you could use
  68.     CDA:
  69.  
  70.         @ECHO OFF
  71.         REM This is sample batch file 1, to back up files to a floppy.
  72.         REM If this is run by a nightly event, you don't want to run the
  73.         REM risk of the drive not being ready and holding up your system
  74.         REM with an error message.  Assuming you're just copying files to
  75.         REM the disk in drive A or B, this should work for you:
  76.         REM
  77.         CDA A
  78.         IF ERRORLEVEL 1 GOTO NOT-A
  79.         GOTO USE-A
  80.         :NOT-A
  81.         CDA B:
  82.         IF ERRORLEVEL 1 GOTO NEITHER
  83.         GOTO USE-B
  84.         :USE-A
  85.         COPY C:\BIN\*.CPP A:
  86.         GOTO END
  87.         :USE-B
  88.         COPY C:\BIN\*.CPP B:
  89.         GOTO END
  90.         :NEITHER
  91.         ECHO Neither drive A nor drive B is ready for use! >> error.log
  92.         :END
  93.  
  94.         @ECHO OFF
  95.         REM This is sample batch file 2, which is a close copy from the
  96.         REM original use for CDA at UniNova.  It checks to make sure the
  97.         REM CD-ROM drive (drive letter J) is ready before looking for
  98.         REM specific files that identify the actual disc in the drive.
  99.         REM
  100.         CDA J
  101.         IF ERRORLEVEL 1 GOTO NODISC
  102.         IF EXIST J:\DISC.1 GOTO ONE
  103.         IF EXIST J:\DISC.2 GOTO TWO
  104.         GOTO NEITHER
  105.         :ONE
  106.         ECHO CD-ROM disc ONE is on-line and ready for use. > hello8.bbs
  107.         GOTO END
  108.         :TWO
  109.         ECHO CD-ROM disc TWO is on-line and ready for use.  > hello8.bbs
  110.         GOTO END
  111.         :NEITHER
  112.         ECHO The on-line CD-ROM is not currently available. > hello8.bbs
  113.         GOTO END
  114.         :NODISC
  115.         ECHO No CD-ROM is on-line at this time. > hello8.bbs
  116.         ECHO ***** CD-ROM not on-line! >> activity.001
  117.         :END
  118.  
  119.     These are just two samples for ways to use CDA in batch files.  You will 
  120.     probably have a use in mind already, which is why you took the time to
  121.     get the program, so these samples may not be fully relevant.
  122.  
  123. COPYRIGHT
  124. ---------
  125.  
  126. Although CDA is free to use, it is not public domain software!  All rights
  127. to CDA are reserved by UniNova Services Corporation.  You are given the
  128. following specific permissions (license), any or all of which may be revoked
  129. at any time:
  130.  
  131.     1.  You may copy, distribute, and use CDA without charge, IF AND ONLY
  132.     IF:
  133.         a) You include all documentation files you received with the copies
  134.         you distribute; and,
  135.         b) You do NOT modify the program or documentation in any way,
  136.         including (but not limited to) removing the copyright notice; and,
  137.         c) You notify the recipient of the copies you distribute that they
  138.         do not own the program but merely have free license to use it in
  139.         the manner outlined in this section.
  140.  
  141.     2.  You may incorporate CDA in your own hardware or software applications
  142.     without royalty, IF AND ONLY IF you obtain written permission from UniNova
  143.     Services Corporation IN ADVANCE.  If you incorporate it in a system
  144.     without prior written permission, you are subject to payment of penalty
  145.     fees and continuing royalties; compared with getting the permission in
  146.     advance, it's not worth it to skip that necessary step.
  147.  
  148. CONTACTING UNINOVA
  149. ------------------
  150.  
  151. UniNova Services Corporation may be contacted via:
  152.  
  153.     Postal mail:    UniNova Services Corporation
  154.                     PO Box 900
  155.                     Ellensburg,  WA    98926
  156.  
  157.     BBS/FAX:        (509) 925-3893  (USA)
  158.  
  159.     CompuServe:     c/o Stuart Whitmore:  71221,1737
  160.     Internet:       c/o Stuart Whitmore:  71221.1737@compuserve.com
  161.  
  162. If you would like to purchase a hard copy of the source code, send a check
  163. or money order to the above postal mail address for $15 (USD).  If you are
  164. in Washington State, add the current state sales tax.  Redistribution of
  165. the source code in any form is strictly prohibited; the code is for your
  166. personal use only.
  167.  
  168. CLOSING NOTES
  169. -------------
  170.  
  171. UniNova and UniNova Services Corporation are trademarks of UniNova Services
  172. Corporation.  Other trademarks, trade names, service marks, etc., that may
  173. appear in this document are the property of their respective owners.
  174.  
  175. Version History, reverse chronology:
  176. 1.50    - Fixed error with reporting that a blank, formatted disk made the
  177.           drive not ready.  Fixed reporting of invalid drives as ready.
  178. 1.00    - Original release.
  179.